package com.itfenxiang.tools.ip.controller;

import com.itfenxiang.tools.ip.utils.IpUtils;
import jakarta.servlet.http.HttpServletRequest;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: TODO
 * @author: 墨凡
 * @date: 2024/4/30 12:00
 * @version: 1.0
 */
@RestController
@RequestMapping("ip")
@AllArgsConstructor
public class IPController {

    @GetMapping()
    public String getRealIp(HttpServletRequest request){
        String realIp = IpUtils.getRealIp(request);
        System.out.println(realIp);
        return realIp;
    }

}
